/**
 * Copyright (C) 2005-2011 by Insider Guides, LLC                       
 * info@framewerk.org                                                   
 *                                                                      
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the      
 * "Software"), to deal in the Software without restriction, including  
 * without limitation the rights to use, copy, modify, merge, publish,  
 * distribute, sublicense, and#or sell copies of the Software, and to   
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:                                            
 *                                                                      
 * The above copyright notice and this permission notice shall be       
 * included in all copies or substantial portions of the Software.      
 *                                                                      
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,      
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF   
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR    
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.                                      
 */
//Marks the right margin of code *******************************************************************
package com.rmc.utils
{
  
  //--------------------------------------
  //  Imports
  //--------------------------------------
  import flash.display.GradientType;
  import flash.display.Graphics;
  import flash.display.InterpolationMethod;
  import flash.display.SpreadMethod;
  import flash.display.Sprite;
  import flash.geom.Matrix;
  
  
  //--------------------------------------
  //  Metadata
  //--------------------------------------
  
  //--------------------------------------
  //  Class
  //--------------------------------------
  /**
   * <p>The <code>GraphicsHelper</code> wraps a UI for drawing API.</p>
   * 
   * <p>AUTHOR 		: Samuel Asher Rivello</p>
   * <p>COMPANY 		: Rivello Multimedia Consulting</p>
   * <p>CREATION DATE 	: Dec 14, 2010</p>
   * 
   * @example Here is a code example. 
   *  
   * <listing version="3.0">
   * <p>Describe this code example.</p>
   *
   * </listing>
   *
   */
  public class GraphicsHelper
  {		
    
    //--------------------------------------
    //  Properties
    //--------------------------------------
    //PUBLIC GETTER/SETTERS
    
    //PUBLIC CONST
    /**
     * Permanent Photo Sizing
     * 
     */
    public static const MEMBER_PHOTO_REGULAR_WIDTH 	: uint = 120;
    
    //PRIVATE
    
    //--------------------------------------
    //  Constructor
    //--------------------------------------

    
    //--------------------------------------
    //  Methods
    //--------------------------------------		
    //PUBLIC	
    
    //PUBLIC STATIC
    /**
     * Draw Solid Rectangle
     * 
     * @return void
     * 
     */
    public static function drawSolidRectangle(graphics : Graphics, width_num : Number, height_num : Number, color_num : Number, alpha_num : Number = 1) : void
    {
      graphics.beginFill(color_num, alpha_num);
      graphics.drawRect(0,0,width_num, height_num);
      graphics.endFill();
    }
    
    /**
     * Draw Gradient Rectangle
     * 
     * @return void
     * 
     */
    public static function drawHorizontalGradientRectangle(graphics : Graphics, width_num : Number, height_num : Number, colors_array : Array, alphas_array : Array, ratios_array : Array ) : void
    {
      var colors:Object = {one: 0xCCFF, two: 0x66FF, three: 0xCC}; 
      var matrix:Matrix = new Matrix(); 
      matrix.createGradientBox( width_num, height_num, 1.58, 0, 0);  
      graphics.beginGradientFill(GradientType.LINEAR, 
        colors_array, 
        alphas_array, 
        ratios_array, 
        matrix , 
        SpreadMethod.PAD, 
        InterpolationMethod.LINEAR_RGB, 
        0); 
      graphics.drawRect(0, 0, width_num, height_num); 
      graphics.endFill();
    }
    
    /**
     * Clear all graphics from <code>Sprite</code>
     * 
     * @param parentToClear_sprite The <code>Sprite</code> to be cleared.
     * 
     * @return void
     * 
     */		
    public static function clearAllGraphics(graphics : Graphics ) : void
    {
        graphics.clear();
    } 
    
    //PRIVATE	
    
  }
}